<?php
	class Admincp_Form_ValidateUser
	{
		public function validUsername($username)
		{
		    $validate = new Zend_Validate_StringLength(6,50);
		    if($validate->isValid($username)) {
		        $validate = new Zend_Validate_Regex('/^[\w._]*$/');
		        if($validate->isValid($username))
		            return true;
		        else
		            return false;
		    }
		    else {
		        
		    }
		}
		
		public function validEmail($email)
		{
		    $validate = new Zend_Validate_StringLength(1,100);
		    if($validate->isValid($email)) {
		        $validate = new Zend_Validate_EmailAddress();
		        if($validate->isValid($email))
		            return true;
		        else
		            return false;
		    }
		    else {
		        return false;
		    }
		}
		
		public function validFullname($fullname)
		{
		    $validate = new Zend_Validate_StringLength(1,50);
		    if($validate->isValid($fullname)) {
		        $validate = new Zend_Validate_Alnum(true);
		        if($validate->isValid($fullname))
		            return true;
		        else
		            return false;
		    }
		    else {
		        return false;
		    }
		}
		
		public function validPassword($password)
		{
		    $validate = new Zend_Validate_StringLength(6,50);
		    if($validate->isValid($password))
		        return true;
		    else
		        return false;
		}
	}
